package org.vectrics.recruiter.struts.admin;

/**
 * @author Mike Moore
 * @version 1.0
 */

import org.apache.log4j.*;
import org.apache.struts.action.Action;


public class JobStatusAction extends Action {
    private static Category log = Category.getInstance(JobStatusAction.class);
    public static String ACTION_NAME = "job_status";
    public static String JOB_PARAM = "jobId";    
    public static String ACTIVE_PARAM = "active";
    

    public JobStatusAction() {
    	//
    }
/*

    protected void doPerform(Request request) {
        log.debug("doPerform() called");
        String jobId = request.getParameter(JOB_PARAM);
        String active = request.getHttpRequest().getParameter(ACTIVE_PARAM);
        String cancel = request.getHttpRequest().getParameter("cancel");

        if (jobId == null) {
            log.error("doPerform() - error job param not specified.");
        }
        
        else if (cancel == null) {
            log.debug("doPerform() submit button pressed - saving..");

            Job job = null;
            
            if (request.hasInvalidParams() == false) {
                log.debug("doPerform() - attempting to find job.");
                try {
                	job = RecruitManager.getInstance().findJob(jobId);
                }
                catch (Exception ex) {
                	log.error("Exception finding job = " + jobId, ex);
                }

                if (job == null) {
                    log.error("doPerform() - job ID not found: " + jobId);
                }
                else {
                    if (active != null) {
                        if (active.toLowerCase().startsWith("t")) {
                            job.setActive(true);
                        }
                        else {
                            job.setActive(false);
                        }
                        
                    }
                    else {
                       log.error("doPerfrom() - status param not specified.");
                    }
                }
                
            }
            
            
        }
        else {
            log.debug("cancel pressed, no action.");
        }
    }
*/
}
